import { Component } from '@angular/core';
import { TableVirtualScrollDataSource } from 'ng-table-virtual-scroll';

const DATA = Array.from({ length: 1000 }, (v, i) => ({
  id: i + 1,
  name: `Element #${i + 1}`,
  name2: `Element2 #${i + 1}`,
  name3: `Element3 #${i + 1}`,
  name4: `Element4 #${i + 1}`,
}));

@Component({
  selector: 'app-window-virtual',
  templateUrl: './window-virtual.component.html',
  styleUrls: ['./window-virtual.component.scss']
})
export class WindowVirtualComponent {
  displayedColumns = ['id', 'name', 'name2', 'name3', 'name4'];

  dataSource = new TableVirtualScrollDataSource(DATA);
}

